package com.mashibing.common.util;

import com.mashibing.common.enums.MobileOperatorEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @author LengMao
 * @date 2023/8/7 13:30
 */
public class OperatorUtil {
    private static Map<String, Integer> operators = new HashMap<>();

    static {
        for (MobileOperatorEnum mobileOperatorEnum :MobileOperatorEnum.values()){
            operators.put(mobileOperatorEnum.getOperatorName(), mobileOperatorEnum.getOperatorId());
        }
    }

    public static Integer getOperatorIdByOperatorName(String operatorName){
        return operators.get(operatorName);
    }

}
